#include"comm.hpp"
#include"log.hpp"

int main()
{
    // 打开文件
    int fd = open(FIFO_FILE, O_WRONLY);
    if(fd < 0)
    {
        perror("open");
        exit(FIFO_OPEN_ERROR);
    }
    cout<<"client open file done"<<endl;

    // 开始通信
    string mes;
    while(true)
    {
        cout<<"Please Enter@ ";
        getline(cin, mes);
        write(fd, mes.c_str(), mes.size());
    }
    close(fd);

    return 0;
}